#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
文件名: 面向对象2.py    
内容:
"""


class A:
    name = "A"

    def __init__(self):
        self.age = 18

    # 实例方法
    def function(self,new_age):
        self.age = new_age

    # 类方法
    @classmethod
    def fun2(cls, new_name):
        cls.name = new_name

    # 静态方法
    @staticmethod
    def fun3():
        print("=====================")


b = A()
print(b.age)
print(b.name)
b.function(29)
print(b.age)
a = A()
print(A.name)
print(a.name)
print(a.age)

A.fun2("B")
print(A.name)
print(a.name)

a.name = "C"
print(a.name)
print(A.name)

A.fun3()
a.fun3()
